﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Vortex.Input {

	/// <summary>
	/// Contains information about mouse move action
	/// </summary>
	public class MouseMoveActionInfo : MouseActionInfo {
		private Point _previousLocation;

		/// <summary>
		/// Initializes a new instance of the <see cref="MouseMoveActionInfo"/> class.
		/// </summary>
		/// <param name="location">The new location of mouse cursor.</param>
		/// <param name="previousLocation">The previous location of mouse cursor.</param>
		/// <param name="keyStates">The key states at the moment of mouse move action.</param>
		public MouseMoveActionInfo(Point location, Point previousLocation, KeyStates keyStates) 
			: base(location, keyStates) {
			_previousLocation = previousLocation;
		}

		/// <summary>
		/// Gets the previous location of mouse cursor.
		/// </summary>
		/// <value>The previous location of mouse cursor.</value>
		public Point PreviousLocation {
			get { return _previousLocation; }
		}

		/// <summary>
		/// Gets the location delta comparing to previous mouse location.
		/// </summary>
		/// <value>The location delta.</value>
		public Point LocationDelta {
			get { return new Point(Location.X - PreviousLocation.X, Location.Y - PreviousLocation.Y); }
		}
	}
}
